# zope imports
from zope.app.annotation.interfaces import IAttributeAnnotatable
from zope.interface import Interface
from zope.app.event.interfaces import IObjectEvent

class IClickCountable(IAttributeAnnotatable):
    """Marker interface to mark an object as countable.
    """

class IClickCounting(Interface):
    """An interface which provides methods for counting and retrieving clicks.
    """
    def click():
        """Just an alias for countClick.
        """
        
    def countClick():
        """Counts a click.
        """

    def getCounters():
        """Returns the counters as a dict.
        """
        
    def getClicks():
        """Returns amount of clicks.
        """

    def setClicks(amount):
        """Sets amount of clicks.
        """            
        
    def copyClicksFrom(source):
        """Copy clicks from given source object.
        """

    def doAfterClick():
        """This method is called after a click has been counted. Per default it
        fires up a IClicked event.
        
        To do your own action after a click has been counted you can either 
        provide your own adapter by inheriting from this one and overwrite 
        this method or you provide a method which subscribes to the IClicked 
        event.
        """
        
class IClicked(IObjectEvent):
    """An interface for the event: user has clicked.
    """